/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package view;

import java.awt.HeadlessException;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import javax.swing.*;
import model.contact;
import view.contact.smallDisplay;

/**
 *
 * @author gramage
 */
public class mainWindow extends JFrame implements ActionListener{

    private JPanel cont;

    public mainWindow(ArrayList al) throws HeadlessException {
        super("Super Address Book");
        this.setSize(300, 600);
        this.setDefaultCloseOperation(mainWindow.EXIT_ON_CLOSE);
        this.setJMenuBar(new menu(al));
        
        // Main Panel
        cont=new JPanel();
        
        // Add small contacts
        for(int i=0; i<al.size(); i++){
            cont.add(new smallDisplay((contact)al.get(i)));
        }
        
        this.add(cont);

        this.setVisible(true);
    }

    public void actionPerformed(ActionEvent e) {
        
    }


}
